/**
 * 
 */
package STUDENTS.VUMANHHUNG;

import java.util.Scanner;

public class tinhngaythangnam {


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String strTemp = "";
		do{
			System.out.println("Moi nhap vao thang? ");
			strTemp = sc.nextLine();
		
		}while (strTemp.isEmpty()
			||Integer.parseInt(strTemp)<1
			||Integer.parseInt(strTemp)>12);
		byte bMonth = Byte.parseByte(strTemp);
		do{
			System.out.println("Moi nhap Nam?");
			strTemp = sc.nextLine();
	
		}while(strTemp.isEmpty());
		int iYear = Integer.parseInt(strTemp);
		
		switch(bMonth){
		case 4:
		case 6:
		case 9:
		case 11: System.out.println("Co 30 ngay"); break;
		case 2: {
			if (iYear % 400==0||( iYear % 4==0 && iYear % 100!= 0))
				System.out.println("co 29 ngay");
			else
				System.out.println("Co 28 ngay");
		} break;
		default: System.out.println("co 31 ngay"); break;
		
		}

	}

}
